module particles 
    use precision
	use points

	type particle
	    character(32):: name = "unknown"
		type(point):: location = point(0.0, 0.0, 0.0)
		type(point):: momentum = point(0.0, 0.0, 0.0)
		real(adequate):: mass = 1.0
		real(adequate):: charge = 0.0
		integer:: serial_number = 0
	end type particle

contains

	function velocity (p)
	    type(particle), intent(in):: p
		type(point) velocity
		velocity = sqrt(p%momentum/p%mass)
	end function velocity

	subroutine move(p, dt)
	   type(particle), intent(inout):: p
	   real(adequate) dt
	   p%location = p%location + velocity(p) * dt
	end subroutine move

end module particles
